package com.glepoch.springbootsecuritymybatis.compoment.easyexcel;


import com.alibaba.excel.EasyExcel;
import com.glepoch.springbootsecuritymybatis.compoment.easyexcel.listen.ExcelListener;

import java.io.InputStream;
import java.util.ArrayList;
import java.util.List;

/**
 * @description:
 * @author: ygl
 * @time: 2021/1/8 20:22
 */
public class EasyExcelUtil<T> {

   public static <T> List<T> importData(InputStream in, Class<T> clazz){
        List<T> datas=new ArrayList<>();
        EasyExcel.read(in, clazz,new ExcelListener<T>(datas,clazz)).sheet().doRead();
        System.out.println(datas);
        return datas;
    }
}
